package OJDemo输入输出;

import java.util.Scanner;

/**
 * @author zc
 * @version 1.0
 * @date 2021/9/7 11:45
 */
public class Main6 {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int t;

        t = cin.nextInt();

        for (int i = 0; i < t; i++) {
            int n = cin.nextInt();
            int ans = 0 ;
            for (int j = 0; j < n; j++) {
                ans+=cin.nextInt();
            }
            System.out.println(ans);
        }
    }
}
